package com.dysm.spring.security.resource.config.bean;

import com.dysm.spring.security.resource.config.filter.RequestBodyHandleFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * 过滤器注册方式：1、通过 FilterRegistrationBean 注册
 */
//@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean<RequestBodyHandleFilter> filterRegistrationBean() {
        FilterRegistrationBean<RequestBodyHandleFilter> registrationBean = new FilterRegistrationBean<>();
        registrationBean.setFilter(new RequestBodyHandleFilter());
        return registrationBean;
    }
}
